<template>
  <div class="fixed-panel">
    <div v-for="item in button">
      <el-button :class="['fixed-btn',options[item].class]" type="primary" circle :title="options[item].title" @click="clickBtn(item)"><i :class="['fa',options[item].icon]" aria-hidden="true"></i></el-button>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      options: {
        edit: {
          class: '',
          title: this.$root.lang.fixedBar.feedback,
          icon: 'fa-edit'
        },
        back: {
          class: 'btn-back',
          title: this.$root.lang.fixedBar.backTop,
          icon: 'fa-caret-up'
        }
      }
    }
  },
  props: {
    button: {
      type: Array,
      default: []
    }
  },
  methods: {
    clickBtn(btn) {
      console.log(btn)
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
@import '@/css/style.scss';
.fixed-panel {
  position: fixed;
  bottom: 4%;
  right: 3%;
  .fixed-btn {
    display: block;
    margin: 0 0 15px 0;
    padding: 0;
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  .btn-back {
    font-size: 20px;
  }
}
</style>
